
# -*- coding: utf-8 -*-
# @Time : 2023/7/18 23:23
# @Author  : lining
# @FileName: 二叉树中序遍历.py
"""
https://leetcode.cn/problems/binary-tree-inorder-traversal/
根节点在中间被访问
"""
class Node():
    def __init__(self, value=0, left=None, right=None):
        self.value = value
        self.left = left
        self.right = right


result = []
def Traversal(node):
    """
    :param node: 开始访问的节点
    :return:
    """
    if node is None:
        return
    Traversal(node.left)
    result.append(node.value)
    Traversal(node.right)
    return result

node = Node(1)
node1 = Node(2)
node2 = Node(3, node1, node)
x = Traversal(node2)
print(x)
